package org.example.express.controller;

import org.example.express.service.ExpressDetialService;
import org.example.model.common.Result;
import org.example.model.vo.login.RealNameAuthenticationVo;
import org.example.model.vo.login.WorkVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/expressdetial")
public class ExpressDetialController {
    @Autowired
    private ExpressDetialService expressDetialService;
    /*实名认证*/
    @RequestMapping("/user/userRealName")
    public Result userRealName(@RequestBody RealNameAuthenticationVo realNameAuthenticationVo){
        return expressDetialService.userRealName(realNameAuthenticationVo);
    }
   /*快递员认证*/
    @RequestMapping("/user/realName")
    public Result realName(@RequestBody WorkVo workVo){
        return expressDetialService.realName(workVo);
    }
    /*查询详细信息*/
    @GetMapping("user/getUserInfo/{registerIp}")
    public Result getUserInfo(@PathVariable("registerIp") String registerIp) {
        return expressDetialService.getUserInfo(registerIp);
    }

    //认证成功
    @PostMapping("user")
    public Result user(@RequestBody RealNameAuthenticationVo realNameAuthenticationVo) {
        return expressDetialService.user(realNameAuthenticationVo);
    }
}
